/*
2021-6-29
https://www.acwing.com/problem/content/3734/
*/

#include<iostream>

using namespace std;
const int N=105;
int a[N];

int main()
{
    ios::sync_with_stdio(false);
    cout.tie(NULL);
    
    int T,n;
    cin>>T;
    while(T--)
    {
        cin>>n;
        for(int i=1;i<=n;i++)
            cin>>a[i];
        for(int i=n;i>n/2;i--)
            cout<<-1*a[i]<<' ';
        for(int i=n/2;i>=1;i--)
            cout<<a[i]<<' ';
        cout<<"\n";
    }
    
    return 0;
}
